|
|
|
|
|
|
|
Visual Basic Table objects have their drawbacks, too. You cannot use a Select statement to initialize a Table object, and you cannot combine data tables to create unique views of the database when you create Table objects. |
|
|
|
|
|
|
|
|
You cannot use Bookmarks, create Filters, or sort the table. Furthermore, you cannot use the Table data object to access ODBC data sources. Only Dynasets and Snapshots can be used with ODBC data sources. |
|
|
|
|
|
|
|
|
Strengths of the Table-type Recordset Data Object |
|
|
|
|
|
|
|
|
The real strength of Table objects is that you can specify Index objects to use when searching for specific records in the table. Table objects also use limited workstation memory and offer instant updates whenever that data in the table changes. |
|
|
|
|
|
|
|
|
Data Pointers and Instant Membership Notification |
|
|
|
|
|
|
|
|
Like Dynasets, Table objects use limited workstation memory because Visual Basic caches pointers to the actual records at the workstation instead of loading all the records into workstation memory. This gives your programs the fastest access speed of all the data objects when you are searching for a single record. |
|
|
|
|
|
|
|
|
Unlike Dynasets and Snapshots, Table objects are not subsets of the data table. They contain all the records in the table at all times. As soon as a new record is added to the data table, the record is available to the Table object. Also, as soon as a user deletes a record from the table, the Table object is updated to reflect the deletion. |
|
|
|
|
|
|
|
|
Table-Type Recordset Objects, Indexes, and the Seek Method |
|
|
|
|
|
|
|
|
The Visual Basic Table-type Recordset data object enables you to specify an index to apply to the data table. You can use indexes to order the data table for displays and reports and to speed searches using the Seek method. |
|
|
|
|
|
|
|
|
The following project (TBSEEK.VBP) demonstrates the use of Visual Basic Table-type Recordset objects, indexes, and the Seek method. It opens the Titles table of the BOOKS5.MDB database and gives you the ability to select one of three indexes. When the index is selected, the program loads the records from the table into a list box. When you click the Search button, you are prompted to enter a search value to use in the Seek method on the table. |
|
|
|
|
|
|
|
|
Use the information in Table 4.2 to build a new Standard EXE project that demonstrates the use of Visual Basic Table objects, indexes, and the Seek method. |
|
|
|
|
|